<template>
    <div>
        <ul class="nav_menu">
            <li class="collapse-btn" @click="toggleSideBar()">
                <i :class="{'gs-icon-zhankai1':isCollapse,'gs-icon-shouqi1':!isCollapse}"></i>
            </li>
        </ul>
        <ul class="nav_menu">
            <li :class="{'active':active===router.name}" v-for="router in showRouterList" :key="router.path"
                :item="router">
                <a :href="router.path">
                    <i :class="'font-md m-r-5 '+router.icon"></i>{{router.title}}
                </a>
            </li>
        </ul>
        <div class="nav_menu" v-show="navShowMore && showRouterList.length>0">
            <el-dropdown @command="routerCommand">
                <span class="el-dropdown-link">
                    <i class="gs-icon-xiajiantou1 gs-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item v-for="(more,index) in moreRouterList" :key="index" :command="more.path"><i
                            :class="more.icon+' font-md m-r-5'"></i>{{more.title}}
                    </el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
        </div>
    </div>
</template>
<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      showRouterList:[],
    }
  },
  computed: {
            isCollapse() {
                return !this.sidebar.opened
            }
        },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
